<template>
  <div class="list">
    <div>
      <ul class="infinite-list">
        <li v-for="(item,index) in listData" :key="index" class="infinite-list-item" @click.stop="$emit('onLocate',item)">
          <span class="el-icon-location poi-location searchPoiResult" />
          <span class="searchPoiResult">{{ item.name }}</span>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
    name: 'List',
    props: {
        listData: {
            type: Array,
            default: function() {
                return []
            }
        }
    },
    data() {
        return {

        }
    },
    computed: {
        noData() {
            return this.listData.length == 0
        }
    }
}
</script>

<style>
.list {
    position: relative;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.list .btn-prev {
    background: transparent;
}

.list .infinite-list {
    color: #fff;
    margin: 10px 0;
    padding: 10px;
    overflow-y: scroll;
    overflow-x: hidden;
    text-decoration: none;
}

.list .infinite-list-item {
    font-size: 14px;
    list-style-type: none;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
    padding: 1em;
    cursor: pointer;
}

.list .infinite-list-item:hover {
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.5);
}

.list ::-webkit-scrollbar {
    display: none;
}
</style>
